package com.cloudkinto.service.product;

import com.cloudkinto.entity.ProductInfoDo;
import com.cloudkinto.entity.ProductStockRackDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.StoragePositionDo;
import com.cloudkinto.extentity.ProductStockDetailDto;
import com.cloudkinto.extentity.stock.ProductStockDto;
import com.cloudkinto.service.product.vo.rack.*;
import com.cloudkinto.service.storage.vo.StockFlowingReq;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author hua`
 * @since 2022-12-21
 */
public interface ProductStockRackService extends IService<ProductStockRackDo> {

    SingleResult addInit();

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<ProductStockRackRes> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);

    PageResult getStockByRackId(Map<String, String> map);

    PageResult getStockList(Map<String, String> map);

    List<ProductStockDetailRes> getStockListAll(Map<String, String> map);

    SingleResult updateStockInit(Map<String, String> map);

    List<StoragePositionDo> getPostions(String storageId);

    void distributeStockBatch(List<DistributeStockReq> reqs, Long userId, Long companyId);

    void distributeStock(DistributeStockReq req, Long userId, Long companyId);

    SingleResult importDistributeStock(MultipartFile file, Long fromStorageId, Long fromRackId, Long userId, Long companyId);

    void distributeStore(DistributeStoreReq req, Long companyId, Long userId);

    void updateStockBatch(List<UpdateStockReq> reqs, Long userId, Long companyId);

    void updateStock(UpdateStockReq req, Long userId, Long companyId);

    void doneApply(DoneUpdateStockReq req, Long userId);

    void applyUpdateStock(UpdateStockReq req, Long userId);

    void confirmApply(Long id, Long userId);

    Map<String, Integer> dealWithOneRackStock(int goodQuantity, int badQuantity, ProductStockRackDo rackDo, String type, Long shopId, String tips, Long userId);

    Map<String, Integer> dealWithOneRackStock(int goodQuantity, int badQuantity, ProductStockRackDo rackDo, String type, Long shopId, String tips, Long userId, boolean flowingFlag);

    Object getFlowing(Map<String, String> map);

    List<ProductStockDto> getProductList(String keyword, Long rackId, Long storageId, Long productId,Long companyId, Integer notRack);

    PageResult getProductListPage(Map<String, String> map);
}
